//
//  FreeManagerSelfOneTableViewCell.m
//  GLGW_Shoping
//
//  Created by whx on 2018/12/8.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "FreeManagerSelfOneTableViewCell.h"

@implementation FreeManagerSelfOneTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        GLGWLabel *nameLab = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(16) theColor:kColor_Rule_Black inSuperView:self.contentView];
        NSString *str = @"小张 ";
        nameLab.text = str;
        [nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView.mas_left).offset(kWidthProportion_In_iPhoneTriploid(15));
            make.top.equalTo(self.contentView.mas_top).offset(kWidthProportion_In_iPhoneTriploid(20));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(22)));
        }];
        nameLab.attributedText = [GLGWLabel addImageName:@"icon_hehuoren" theImageFram:CGRectMake(0, -3, kWidthProportion_In_iPhoneTriploid(53), kHeightProportion_In_iPhoneTriploid(14)) theTextString:str atImageIndex:str.length];
        
        GLGWLabel *arLab = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(12) theColor:[UIColor colorWithHexString:@"#666666"] inSuperView:self.contentView];
        arLab.text = @"北京 朝阳区";
        arLab.numberOfLines = 0;
        [arLab mas_updateConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(nameLab.mas_left);
            make.top.equalTo(nameLab.mas_bottom).offset(kWidthProportion_In_iPhoneTriploid(9));
            make.right.equalTo(self.contentView.mas_right).offset(-kWidthProportion_In_iPhoneTriploid(15));
            make.bottom.equalTo(@(-kHeightProportion_In_iPhoneTriploid(20)));
        }];
        
        GLGWButton *rigtBtn = [[GLGWButton alloc] initWithTitle:@"进入店铺" titleLableFont:SYSTEMFONT(12) titleLableColor:[UIColor colorWithHexString:@"#999999"] inSuperView:self.contentView];
        [rigtBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.equalTo(@(kWidthProportion_In_iPhoneTriploid(70)));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(24)));
            make.top.equalTo(@(kHeightProportion_In_iPhoneTriploid(24)));
            make.right.equalTo(@(-kWidthProportion_In_iPhoneTriploid(15)));
        }];
        rigtBtn.layer.cornerRadius = kHeightProportion_In_iPhoneTriploid(12);
        rigtBtn.layer.borderWidth = 0.5;
        rigtBtn.layer.borderColor = [UIColor colorWithHexString:@"#EAEAEA"].CGColor;
        [rigtBtn addTarget:self action:@selector(rightAction:) forControlEvents:UIControlEventTouchUpInside];
        
    }
    return self;
}

- (void)rightAction:(GLGWButton *)sender
{
    if (self.BlockInto) {
        self.BlockInto(sender);
    }
}

@end
